export default function (req, res) {
    // Define available pay types and signer needed based on a fixed logic or random
    const allPayTypes = [1, 2, 3, 4]; // 1:交付课时, 2:外部支付, 3:智牛币支付, 4:在线支付
    const availablePayTypes = [
      // Randomly select a subset of pay types for mock response
      ...new Set(Array.from({ length: Math.floor(Math.random() * 4) + 1 }, () => allPayTypes[Math.floor(Math.random() * allPayTypes.length)]))
    ];
    
    const signerNeeded = Math.random() > 0.5; // Randomly decide if a signer is needed
  
    // Generate a random number for unused classtime
    const unusedClasstime = parseFloat((Math.random() * 100).toFixed(1));
  
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 0,
          message: '成功！',
          data: {
            payTypes: [1,2,3,4],
            unusedClasstime: unusedClasstime,
            signerNeeded: signerNeeded,
          },
          timestamp: Date.now(),
          requestId: 'requestId_' + Math.random().toString(36).substring(2, 15),
          signature: 'signature_' + Math.random().toString(36).substring(2, 15),
        });
      }, 100);
    });
  }